
public class Book {
	//3. 以面向对象的思想，编写自定义类描述图书信息。设定属性包括：书名，作者，出版社名，价格；方法包括：信息介绍
	private String title;//书名
	private String author;//作者
	private String press;//出版社名
	private double price;//价格
	public Book() {
	}
   public Book(String title,String author,String press,double price) {
	    this.title=title;
	    this.author=author;
		this.setPress(press);
		this.setPrice(price);
	}
	public String getTitle() {
		
		return title;
	}
	
	public String getAuthor() {
		
		return author;
	}
	
	public String getPress() {
		return press;
	}
	public void setPress(String press) {
		this.press = press;
	}
	public double getPrice() {
		return price;
	}
	public void setPrice(double price) {
		if(price>10) {
			this.price = price;
		}else {
			System.out.println("不好意思，您给你的书钱有误！");
		}
	}
	public void showBookfo() {
		System.out.print("此书名叫："+this.title+",作者是："+this.author+",出版社名："+this.press+",出售价格是："+this.price);
	}
	public static void main(String[] args) {
		Book book=new Book("斗罗大陆","唐家三少","北大青鸟出版社", 90);
		book.showBookfo();
	}
	
}
